home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mc51bugs / q31559 < prev    next >
Text File  |  1988-07-20  |  1KB  |  30 lines

  1. Q31559 Allocating More Than 4 Megabytes, Loss of Speed after 32K
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Question:
  7.    I have written a program in C that allocates memory in 32K pieces
  8. to see how much memory is available to my program. Malloc returns a
  9. null at about 4 megabytes. I thought that I had access to 1 gigabyte
  10. of memory with OS/2. Is there a limitation that I do not know about
  11. with malloc in OS/2? Also, the system slows down extremely after the
  12. first 32K gets allocated. What causes that?
  13.  
  14. Response:
  15.    Under C Version 5.10, malloc is limited to 64 segment-resource
  16. pools, which means malloc can only allocate 4 megabytes of memory
  17. under OS/2. This limitation is a constant in the malloc run-time
  18. routine and can be raised by modifying the library source code.
  19.    The speed degradation is caused by malloc scanning the segments for
  20. a block of free memory, most of which has been swapped to disk;
  21. therefore, performance degradation ("thrashing") occurs as the memory
  22. is swapped in and out from disk.
  23.    Microsoft has confirmed this to be a problem in Version 5.10 of the
  24. C compiler.
  25.    We are researching this problem and will post new information as it
  26. becomes available.
  27.  
  28. Keywords:  buglist5.10
  29. Updated  88/07/21 03:19
  30.